#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <vector>
using namespace std;

#include "AVL.h"

int main()
{
	//int a[] = { 16,3,7,11,9,26,18,14,15 };
	//int a[] = { 4,2,6,1,3,5,15,7,16,14 };

	int N = 1000000;
	srand((unsigned int)time(nullptr));
	vector<int> v;
	for (int i = 0; i < N; i++)
	{
		v.push_back(rand()+i);
	}
	AVLTree<int, int> t; 
	for (auto x : v)
	{
		t.insert(make_pair(x,x));
	}

	//t.Inorder();
	cout << t.IsBlance() << endl;    
	cout << t.Height() << endl;
	cout << t.Size() << endl;

	size_t begin1 = clock();
	for (auto e : v)
	{
		t.Find(e);
	}
	size_t end1 = clock();
	cout << "FIND:" << end1 - begin1 << endl;

	return 0;
}